﻿//MEMBERS
	members = new Array();

	members[0] = new Object();
	members[0].name = "Jonas Wilhelm";
	members[0].address = "Nordi Nordbahnhof 2";
	members[0].tel = "017664803917";
	members[0].mail = "jonas_wilhelm@yahoo.de";
	
	members[1] = new Object();
	members[1].name = "Sascha Gros";
	members[1].address = "Ehningen";
	members[1].tel = "017661465186";
	members[1].mail = "gros.sascha@googlemail.com";	
	
	members[2] = new Object();
	members[2].name = "Marcel Buesing";
	members[2].address = "Zuffenhausen";
	members[2].tel = "01636516813";
	members[2].mail = "buesing.marcel@googlemail.com";
	
//ISSUES
	var issues = new Array();
	
	issues[0] = new Object();
	issues[0]['author'] = members[0].name;
	issues[0]['date'] = "Datum"
	issues[0]['involved'] = members[1].name; 
	issues[0]['topic'] = "Code Review";
	issues[0]['descr'] = "Bitte um Review der Methode \"injectCrystal()\"";
	issues[0]['status'] = 'done';
	
	issues[1] = new Object();
	issues[1]['author'] = members[1].name;
	issues[1]['date'] = "Datum hier"
	issues[1]['involved'] = members[0].name; 
	issues[1]['topic'] = "Documentation Review";
	issues[1]['descr'] = "Bitte um ein Review des Kapitels \"Furzscheißer\" (Seite 32)";
	issues[1]['status'] = 'pending';
	
//NEWS
	var news = new Array();
	news['overview'] = new Array();
	news['project'] = new Array();
	
	news['overview'][0] = new Object({
									title: "SCRUMTHING v0.5 released",
									txt: "Die neue hypergeile SCRUMTHING-Plattform ist nun endlich soweit. Zögere nicht und lade dir deine eigene " +
									     "Managementsoftware für große Softwareprojekte direkt hier herunter"
						  });
	
	news['project'][0] = new Object({
							title: "Projektmanager Büsing muss gehen!",
							txt: "Nach einer Sexaffäre muss Projektmanager Marcel Büsing leider gehen. Focus berichtet mehr hier."
					  });
	news['project'][1] = new Object({
							title: "Sascha Gros in Scheißlaune",
							txt: "Die inakzeptable Laune von Sascha Gros führte diese Woche zu unschoenen Kackstimmungen und Vibes. Vielen Dank nochmal an dieser Stelle!"
					  });
	
//CONTENT
	scripts = new Object();
	scripts['issueTracker'] = 'issueTracker.js';

jQuery(document).ready(function(){
	$.creaseFont();
	HistoryManager.init();
	StyleManager.init();
});


//News manager
	var NewsManager = {
		init: function(sec) {
			$('#news').html('<h2>NEUIGKEITEN</h2>');
			$.each(news[sec], function() {
				$('#news').append($('<h4>' + this.title + '</h4><p>' + this.txt + '</p>'));
			});
		}
	}

//Style Management
	var StyleManager = {
		init: function() {
			$('#styleMod a').click(function() {
				$('#style').attr('href', 'css/' + $(this).attr('id') + '.css');
				$('#imgSearch').attr('src','img/search'+ $(this).attr('id') + '.png');
				return false;
			});
		}
	}

//Content management
	var HistoryManager = {
		_this: this,
		currentHash: '',
		init: function() {			
			if(location.hash === '') location.hash = '#overview';
			
			$(window).hashchange(function() {
				HistoryManager.hashChanged();
			});
			$(window).hashchange();
			this.currentHash = location.hash;
		},
		hashChanged: function() {
			ContentManager.getContent(location.hash.replace('#', ''));
			this.currentHash = location.hash;
		}
	};	
	
	var ContentManager = {
		getContent: function(hash) {
			if(hash != 'overview') {
				if(hash != 'addProject') {
					$('#nav').load('nav.html', function() {
						$('a[href="#' + hash + '"]').attr('class', 'active');
					});
				}
				$('a[href="#overview"]').show();
			}
			$('#content').load(hash + '.html', function() {
			});
		}
	}
	
